import { useIntersectionObserver } from "@vueuse/core";
import { install } from "element-plus";
export const lazyPlugin={
    install(app){
        app.directive("img-lazy", {
            mounted(el, binding) {
              const { stop } = useIntersectionObserver(el, ([{ isIntersecting }]) => {
                if (isIntersecting) {
                  el.src = binding.value;
                  // 加载后就不在加载
                  
                  stop();
                }
              });
            },
          });
    }
}